<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Excalibur</title>

    <!-- Favicon -->
    <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">

    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/vendor/bootstrap.min.css') }}">

    <!-- Custom styles for this template -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/base.css') }}">
    <link href="https://fonts.googleapis.com/css?family=Montserrat|Roboto" rel="stylesheet">
    {% block stylesheet %}{% endblock %}
  </head>

  <body>

    <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top primary-bg">
      <a class="navbar-brand" href="/">Excalibur</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <!-- http://jinja.pocoo.org/docs/2.10/tricks/#highlighting-active-menu-items -->
      {% set navigation_bar = [
          ('/files', 'files', 'Files'),
          ('/rules', 'rules', 'Rules'),
          ('/jobs', 'jobs', 'Jobs')
      ] -%}
      {% set active_page = active_page|default('files') -%}
      <div class="collapse navbar-collapse" id="navbarsExampleDefault">
        <ul class="navbar-nav mr-auto">
          {% for href, id, caption in navigation_bar %}
            {% if id == active_page %}
              <li class="nav-item active">
                <a class="nav-link" href="{{ href|e }}">{{ caption|e }}</a>
              </li>
            {% else %}
              <li class="nav-item">
                <a class="nav-link" href="{{ href|e }}">{{ caption|e }}</a>
              </li>
            {% endif %}
          {% endfor %}
        </ul>
        <ul class="navbar-nav ml-auto">
          <li class="nav-item active">
            <a class="nav-link" href="https://opencollective.com/excalibur/" target="_blank">Support Excalibur on OpenCollective!</a>
          </li>
        </ul>
      </div>
    </nav>

    {% block files %}{% endblock %}
    {% block workspace %}{% endblock %}
    {% block rules %}{% endblock %}
    {% block jobs %}{% endblock %}
    {% block job %}{% endblock %}

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/jquery-3.3.1.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/popper.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/bootstrap.min.js') }}"></script>
    {% block javascript %}{% endblock %}
  </body>
</html>
